package com.orion.service.rhlc;

import com.orion.entity.Building;
import com.orion.entity.Car;
import com.orion.entity.Comment;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.indices.CreateIndexResponse;
import org.elasticsearch.client.indices.GetIndexResponse;

import java.io.IOException;

/**
 * @author Administrator
 */
public interface IRhlcEsService {
    CreateIndexResponse createIndex(String idx, Integer numberOfShards, Integer numberOfReplicas) throws IOException;

    GetIndexResponse indexInfo(String idx) throws IOException;

    AcknowledgedResponse deleteIndex(String idx) throws IOException;

    GetResponse queryDocById(String idx, Long id) throws IOException;

    UpdateResponse update(String idx, Building building) throws IOException;

    DeleteResponse delete(String idx, Long id) throws IOException;

    IndexResponse addDoc(String idx, Building building) throws IOException;

    SearchResponse queryDeepPage(String idx, int pageSize, int from, Building building) throws IOException;

    SearchResponse queryComposite(String idx, Building building) throws IOException;

    SearchResponse aggs(String idx) throws IOException;

    SearchResponse aggsComposite(String idx) throws IOException;

    SearchResponse aggsMultiGroup(String idx) throws IOException;

    SearchResponse aggsBros(String idx) throws IOException;

    SearchResponse complexAggs(String idx) throws IOException;

    SearchResponse aggsFilterQuery(String idx, Car car) throws IOException;

    SearchResponse suggest(String idx, String prefix) throws IOException;

    SearchResponse nested(String idx, Comment comment) throws IOException;
}
